#include "Character.h"


Character::Character(void)
{
}


Character::~Character(void)
{
}

void Character::Damage(int Amount)
{
	currentHP -= Amount;
	if(currentHP < 0)
	{
		currentHP = 0;
		KO = true;
	}
}

void Character::HealHP(int Amount)
{
	currentHP += Amount;

	if(currentHP > MaxHP)
		currentHP = MaxHP;
}
void Character::ReduceMP(int Amount)
{
	currentMP -= Amount;

	if(currentMP < 0)
		currentMP = 0;
}

void Character::HealMP(int Amount)
{
	currentMP += Amount;

	if(currentMP > MaxMP)
		currentMP = MaxMP;
}

void Character::Revive()
{
	KO = false;
	currentHP = MaxHP / 4;
}

void Character::increaseLevel()
{
	
	++Level;

	switch(CharClass)
	{
	case HERO:
		MaxHP += 15;
		MaxMP += 2;
		Str += 2;
		Def += 2;
		MagDef +=2;
		MagAtk +=2;
	break;
	case KNIGHT:
		MaxHP += 20;
		Str += 3;
		Def += 3;
		MagDef +=1;
	break;
	case WIZARD:
		MaxHP += 10;
		MaxMP += 5;
		Str += 1;
		Def += 1;
		MagDef += 3;
		MagAtk += 3;
	break;
	}
}